<?php

/**
 * Operaciones form base class.
 *
 * @package    tercermilenio
 * @subpackage form
 * @author     Your name here
 */
class BaseOperacionesForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'op_id'      => new sfWidgetFormInputHidden(),
      'op_monto'   => new sfWidgetFormInput(),
      'op_motivo'  => new sfWidgetFormInput(),
      'op_tipo'    => new sfWidgetFormPropelChoice(array('model' => 'TipoOperaciones', 'add_empty' => false)),
      'op_usuario' => new sfWidgetFormPropelChoice(array('model' => 'sfGuardUser', 'add_empty' => false)),
      'created_at' => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'op_id'      => new sfValidatorPropelChoice(array('model' => 'Operaciones', 'column' => 'op_id', 'required' => false)),
      'op_monto'   => new sfValidatorNumber(),
      'op_motivo'  => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'op_tipo'    => new sfValidatorPropelChoice(array('model' => 'TipoOperaciones', 'column' => 'tip_op_tipo')),
      'op_usuario' => new sfValidatorPropelChoice(array('model' => 'sfGuardUser', 'column' => 'id')),
      'created_at' => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('operaciones[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Operaciones';
  }


}
